package com.yenlien.traceyun.plant.entity;

import com.yenlien.traceyun.business.entity.TraceScanEntity;
import com.yenlien.traceyun.business.trace.Trace;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 田间管理
 *
 * @author maybe
 * @date 2020年7月24日
 */
@Entity
@Table(name = "t_plant_farm")
@Trace(appName = "plant", stepName = "farm", parentStepName = {"plant"}, order = 1, conditions = "status!=2")
public class Farm extends TraceScanEntity {

    @Column
    private String plantId;        //种植ID   好像是基地ID
    //===============整地、灌溉、除草、病虫害、其他===============
    @Column
    private String type;        //田间管理类型
    @Column
    private String way;            //整地、灌溉方式
    @Column
    private String principalId;    //操作人ID  负责人
    @Column
    private String principalName;//操作人姓名

    @Column(name = "job_person_id", length = 32)
    private String jobPersonId;        //完成人ID
    @Column
    private String jobPersonName;    //完成人姓名  执行人
    @Column
    private String beginTime;    //开始时间
    @Column
    private String endTime;        //结束时间
    @Column
    private String img;            //操作图片

    //===============移栽===============
    @Column
    private String soilId;        //移栽地块ID
    @Column
    private String soildName;    //移栽地块名称
    @Column
    private String batch;            //种植批次号

    @Column
    private int status;            //农事操作(0:自己完成，1：发布任务,2:任务明细)

    @Column(name = "finished")
    private boolean finished; //完成状态   0未完成   1已完成


    private String coordinate;            //坐标


    @ApiModelProperty(value = "分类： 1 = 整地、灌溉、病虫害等(不需要投入品), 2 = 施肥(需要投入品)")
    private String typeLevel;



    @ApiModelProperty(value = "作业类型： 植保管理/土水肥管理/园艺管理/日常管理")
    private String taskType;

    @ApiModelProperty(value = "重要程度")
    private String importanceLevel;

    @ApiModelProperty(value = "方案(富文本)")
    @Column(columnDefinition = "longtext")
    private String programme;

    @ApiModelProperty(value = "是否超时(当前时间大于endTime时)预警提醒")
    private boolean alarmFlag;

    @ApiModelProperty(value = "提醒有快要开始的农事(当前时间小于beginTime)")
    private boolean noticeFlag;

    @ApiModelProperty(value = "提前提醒的天数")
    private Integer noticeDay;





    /**
     * 发布任务，则有pid
     */
    @Column(name = "pid", length = 32)
    private String pid;

    @Column(name = "job_person_names", length = 1000)
    private String jobPersonNames; //任务分配的人

    //施肥
    @Transient
    private List<FarmInputs> list;
    @Transient
    private String farmInputsList;
    @Transient
    private String farmInputsList2;
    @Transient
    private String userIds;


    public boolean isNoticeFlag() {
        return noticeFlag;
    }

    public void setNoticeFlag(boolean noticeFlag) {
        this.noticeFlag = noticeFlag;
    }

    public Integer getNoticeDay() {
        return noticeDay;
    }

    public void setNoticeDay(Integer noticeDay) {
        this.noticeDay = noticeDay;
    }

    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public String getImportanceLevel() {
        return importanceLevel;
    }

    public void setImportanceLevel(String importanceLevel) {
        this.importanceLevel = importanceLevel;
    }

    public String getProgramme() {
        return programme;
    }

    public void setProgramme(String programme) {
        this.programme = programme;
    }

    public boolean isAlarmFlag() {
        return alarmFlag;
    }

    public void setAlarmFlag(boolean alarmFlag) {
        this.alarmFlag = alarmFlag;
    }

    public String getFarmInputsList2() {
        return farmInputsList2;
    }

    public void setFarmInputsList2(String farmInputsList2) {
        this.farmInputsList2 = farmInputsList2;
    }

    public String getTypeLevel() {
        return typeLevel;
    }

    public void setTypeLevel(String typeLevel) {
        this.typeLevel = typeLevel;
    }

    public String getCoordinate() {
        return coordinate;
    }

    public void setCoordinate(String coordinate) {
        this.coordinate = coordinate;
    }

    public String getPlantId() {
        return plantId;
    }

    public void setPlantId(String plantId) {
        this.plantId = plantId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getWay() {
        return way;
    }

    public void setWay(String way) {
        this.way = way;
    }

    public String getPrincipalId() {
        return principalId;
    }

    public void setPrincipalId(String principalId) {
        this.principalId = principalId;
    }

    public String getPrincipalName() {
        return principalName;
    }

    public void setPrincipalName(String principalName) {
        this.principalName = principalName;
    }

    public String getJobPersonId() {
        return jobPersonId;
    }

    public void setJobPersonId(String jobPersonId) {
        this.jobPersonId = jobPersonId;
    }

    public String getJobPersonName() {
        return jobPersonName;
    }

    public void setJobPersonName(String jobPersonName) {
        this.jobPersonName = jobPersonName;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getSoilId() {
        return soilId;
    }

    public void setSoilId(String soilId) {
        this.soilId = soilId;
    }

    public String getSoildName() {
        return soildName;
    }

    public void setSoildName(String soildName) {
        this.soildName = soildName;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getFarmInputsList() {
        return farmInputsList;
    }

    public void setFarmInputsList(String farmInputsList) {
        this.farmInputsList = farmInputsList;
    }

    public List<FarmInputs> getList() {
        return list;
    }

    public void setList(List<FarmInputs> list) {
        this.list = list;
    }

    public String getUserIds() {
        return userIds;
    }

    public void setUserIds(String userIds) {
        this.userIds = userIds;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getJobPersonNames() {
        return jobPersonNames;
    }

    public void setJobPersonNames(String jobPersonNames) {
        this.jobPersonNames = jobPersonNames;
    }

    public boolean isFinished() {
        return finished;
    }

    public void setFinished(boolean finished) {
        this.finished = finished;
    }

    public String getBatch() {
        return batch;
    }

    public void setBatch(String batch) {
        this.batch = batch;
    }
}
